package com.job.Job;

import org.openqa.selenium.By;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.Test;


public class NaukriPage extends TestBase{
	
	private static final Logger LOGGER = LoggerFactory.getLogger(NaukriPage.class);
	
	
	@Test
	public void start(){
		try {
			login();
			LOGGER.info("Logged into naukri");
			clickUpdateButton();
			clickEditProfile();
			LOGGER.info("Profile Updated successfully");
		} catch (Exception e) {
			LOGGER.error(e.getMessage());
		}
	}
	
	
	public void login() throws Exception{
		if(adminPage == null){
			login("chaitu.msit@gmail.com","Abcdefgh1");
		}
	}
	
	public void clickUpdateButton(){
		adminPage.click(By.xpath("//div[4]/div[2]/div/div[5]/div[4]/div[1]/button"));
	}
	
	public void clickEditProfile(){
		
		adminPage.click(By.xpath("//div[4]/div[2]/div/div[1]/div[2]/h1/a"));
		adminPage.clear(By.xpath("//div[4]/div[2]/div/div/form/div[2]/p/textarea"));
		adminPage.type(By.xpath("//div[4]/div[2]/div/div/form/div[2]/p/textarea"), "IT Professional with 2 years of experience in J2SE,J2EE,Spring and Hibernate");
		adminPage.click(By.xpath("//html/body/div[4]/div[2]/div/div/form/div[5]/div/button"));
	}

}
